1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Sub tihuan()
Dim rCell As Range
For Each rCell In Selection
If rCell.Value = "差旅费" Then rCell.Value = "Fee_0"
If rCell.Value = "业务招待费" Then rCell.Value = "Fee_1"
If rCell.Value = "公务车费用" Then rCell.Value = "Fee_2"
If rCell.Value = "办公费" Then rCell.Value = "Fee_3"
If rCell.Value = "因公临时出国(境)" Then rCell.Value = "Fee_4"
If rCell.Value = "培训费" Then rCell.Value = "Fee_5"
If rCell.Value = "工会经费" Then rCell.Value = "Fee_6"
If rCell.Value = "通讯费" Then rCell.Value = "Fee_7"
If rCell.Value = "会议费" Then rCell.Value = "Fee_8"
If rCell.Value = "团队建设费" Then rCell.Value = "Fee_9"
Next
End Sub

2019-02-19.15.33.53-image.png

在excel选取目标区域后,在代码这边点三角箭头执行操作。

https://zhidao.baidu.com/question/577811144.html

列运算

2019-02-19.17.19.17-image.png

2019-02-19.17.19.17-image.png

2019-02-19.17.19.41-image.png

2019-02-19.17.19.41-image.png

2019-02-19.17.19.54-image.png

2019-02-19.17.19.54-image.png

2019-02-19.17.20.10-image.png

2019-02-19.17.20.10-image.png

2019-02-19.17.20.20-image.png

2019-02-19.17.20.20-image.png